﻿<UserControl
	xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
	xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
	xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
	xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
	xmlns:local="clr-namespace:JBot"
	mc:Ignorable="d"
	x:Class="JBot.ServicesControl"
	x:Name="UserControl"
	d:DesignWidth="640" d:DesignHeight="480">

	<UserControl.Resources>
		<local:StatusTypeConverter x:Key="StatusTypeConverter"/>
	</UserControl.Resources>

	<Grid x:Name="SRoot">
		<Grid.RowDefinitions>
			<RowDefinition Height="45"/>
			<RowDefinition Height="30"/>
			<RowDefinition Height="0.887*"/>
		</Grid.RowDefinitions>
		<Label x:Name="S_L" HorizontalAlignment="Left" Margin="8,4,0,0" VerticalAlignment="Top" Content="Services" FontSize="17.333"/>
		<ToolBar x:Name="S_TB" Grid.Row="1">
			<Button x:Name="S_TB_Add" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Content="Add"/>
			<Button x:Name="S_TB_Edit" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Content="Edit"/>
			<Button x:Name="S_TB_Delete" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Content="Delete"/>
		</ToolBar>
		<ListView x:Name="S_LV" Grid.Row="2" ItemsSource="{Binding Services, Source={StaticResource xmpp}}">
			<ListView.View>
				<GridView>
					<GridViewColumn Header="" Width="30">
						<GridViewColumn.CellTemplate>
							<DataTemplate>
								<Image Height="16" Width="16" Source="{Binding StatusType, Converter={StaticResource StatusTypeConverter}}" />
							</DataTemplate>
						</GridViewColumn.CellTemplate>
					</GridViewColumn>
					<GridViewColumn Header="JID" DisplayMemberBinding="{Binding Jid}" />
					<GridViewColumn Header="Service name"  DisplayMemberBinding="{Binding Nickname}" />
					<GridViewColumn Header="Description" DisplayMemberBinding="{Binding Status}" />
				</GridView>
			</ListView.View>
		</ListView>
	</Grid>
</UserControl>